package cn.tedu.mybatis.mapper;

import cn.tedu.mybatis.pojo.weibo;
import cn.tedu.mybatis.pojo.weiboVO1;
import cn.tedu.mybatis.pojo.weiboVO3;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface wmapper
{
    @Insert("INSERT INTO WEIBO(CONTENT,CREATED,USER_ID) VALUES(#{content},#{created},#{userid})")
    int insertWeibo(weibo weibo);
//    @Insert("INSERT INTO WEIBO(CONTENT,CREATED,USER_ID) VALUES(#{content},#{created},#{userid})")
    int insertWeibo2(weibo weibo);
    @Delete("DELETE FROM WEIBO WHERE ID=#{ID}")
    int deleteWeibo(Integer ID);
//    @Update("UPDATE WEIBO SET CONTENT=#{content},CREATED=#{created},USER_ID=#{userid} WHERE ID=#{id}")
    int updateWeibo(weibo weibo);
    @Select("SELECT ID,CONTENT,CREATED,USER_ID userid FROM WEIBO")
    List<weibo> selectWeibo();
    @Select("SELECT CONTENT,CREATED FROM WEIBO WHERE ID=#{id}")

    weiboVO1 selectWeiboById(Integer id);
    List<weibo> selectWeibo2();

    int dynamicupdateweibo(weibo weibo);//动态修改
    int dynamicdeleteweibo(Integer[] ids);//动态删除
    int dynamicdeleteweibo2(List<Integer> ids);
    int countweibo();
    weiboVO3 selectWeibo3byid(Integer id);
    List<weiboVO3> selectWeibo3();

}
